<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<!--{$page_charset}-->" />
<title>宝物内容</title>
<meta name="author" content="<!--{$copyright_author}-->" />
<link type="text/css" rel="stylesheet" href="oecms/css/admin.css" media="screen" />
<script type='text/javascript' src='js/jquery-1.4.4.min.js'></script>
<script type='text/javascript' src='js/command.js'></script>
<script type="text/javascript" src='../data/editor/kindeditor.js'></script>
</head>
<body>
<!--{if $action eq ""}-->
<div class="main-wrap">
  <div class="path"><p>当前位置： 宝物管理<span>&gt;&gt;</span>吉祥宝物</p></div>
  <div class="main-cont">
    <h3 class="title"><a href="oecms_product.php?action=add" class="btn-general"><span>发布宝物</span></a>吉祥宝物</h3>
	<div class="search-area ">
	  <form method="post" id="search_form" action="oecms_product.php" />
	  <div class="item">
	    <label>宝物分类：</label><!--{$cate_search}-->&nbsp;&nbsp;
		<label>标题：</label><input type="text" id="sname" name="sname" size="20" class="input" value="<!--{$sname}-->" />&nbsp;&nbsp;&nbsp;
		<input type="submit" class="button_s" value="搜 索" />
	  </div>
	  </form>
	</div>
	<form action="oecms_product.php" method="post" name="myform" id="myform" style="margin:0">
	<input type="hidden" name="action" id="action" value="del" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
	  <thead class="tb-tit-bg">
	  <tr>
	    <th width="8%"><div class="th-gap">选择</div></th>
		<th width="12%"><div class="th-gap">所在分类</div></th>
		<th width="12%"><div class="th-gap">预览图</div></th>
		<th width="20%"><div class="th-gap">宝物名称</div></th>
		<th width="8%"><div class="th-gap">浏览</div></th>
		<th width="7%"><div class="th-gap">状态</div></th>
		<th width="7%"><div class="th-gap">推荐</div></th>
		<th width="10%"><div class="th-gap">录入时间</div></th>
		<th><div class="th-gap">操作</div></th>
	  </tr>
	  </thead>
	  <tfoot class="tb-foot-bg"></tfoot>
	  <!--{foreach $product as $volist}-->
	  <tr onMouseOver="overColor(this)" onMouseOut="outColor(this)">
	    <td align="center"><input name="id[]" type="checkbox" value="<!--{$volist.productid}-->" onClick="checkItem(this, 'chkAll')"><!--{$volist.productid}--></td>
		<td align="center"><!--{$volist.catename}--></td>
		<td align="center">
		<!--{if $volist.thumbfiles!=''}-->
		<a href="../<!--{$volist.uploadfiles}-->" target="_blank"><img src="../<!--{$volist.thumbfiles}-->" width="100" height="100" border="0" /></a>
		<!--{else}-->
		<img src="../tpl/static/images/s_nopic.jpg" width="100" height="100" border="0" />
		<!--{/if}-->
        </td>
		<td align="left"><a href="../product.php?mod=detail&id=<!--{$volist.productid}-->" target="_blank"><!--{$volist.productname}--></a></td>
		<td align="center"><!--{$volist.hits}--></td>
		<td align="center">
		<!--{if $volist.flag==0}-->
			<input type="hidden" id="attr_flag<!--{$volist.productid}-->" value="flagopen" />
			<img id="flag<!--{$volist.productid}-->" src="oecms/images/no.gif" onClick="javascript:fetch_ajax('flag','<!--{$volist.productid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.productid}-->" value="flagclose" />
			<img id="flag<!--{$volist.productid}-->" src="oecms/images/yes.gif" onClick="javascript:fetch_ajax('flag','<!--{$volist.productid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
        </td>
		<td align="center">
		<!--{if $volist.elite==0}-->
			<input type="hidden" id="attr_elite<!--{$volist.productid}-->" value="eliteopen" />
			<img id="elite<!--{$volist.productid}-->" src="oecms/images/no.gif" onClick="javascript:fetch_ajax('elite','<!--{$volist.productid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_elite<!--{$volist.productid}-->" value="eliteclose" />
			<img id="elite<!--{$volist.productid}-->" src="oecms/images/yes.gif" onClick="javascript:fetch_ajax('elite','<!--{$volist.productid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
        </td>
		<td align="center"><!--{$volist.timeline|date_format:"%Y/%m/%d"}--></td>
		<td align="center"><a href="oecms_product.php?action=edit&id=<!--{$volist.productid}-->&page=<!--{$page}-->&<!--{$urlitem}-->" class="icon-edit">编辑</a>&nbsp;&nbsp;<a href="oecms_product.php?action=del&id[]=<!--{$volist.productid}-->" onClick="{if(confirm('确定要删除该信息?')){return true;} return false;}" class="icon-del">删除</a></td>
	  </tr>
	  <!--{foreachelse}-->
      <tr>
	    <td colspan="9" align="center">暂无信息</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{if $total>0}-->
	  <tr>
		<td align="center"><input name="chkAll" type="checkbox" id="chkAll" onClick="checkAll(this, 'id[]')" value="checkbox"></td>
		<td class="hback" colspan="8"><input class="button" name="btn_del" type="button" value="删 除" onClick="{if(confirm('确定删除选定信息吗!?')){$('#action').val('del');$('#myform').submit();return true;}return false;}" class="button">&nbsp;&nbsp;共[ <b><!--{$total}--></b> ]条记录</td>
	  </tr>
	  <!--{/if}-->
	</table>
	</form>
	<!--{if $pagecount>1}-->
	<table width='95%' border='0' cellspacing='0' cellpadding='0' align='center' style="margin-top:10px;">
	  <tr>
		<td align='center'><!--{$showpage}--></td>
	  </tr>
	</table>
	<!--{/if}-->
  </div>
</div>
<!--{/if}-->

<!--{if $action eq "setting"}-->
<div class="main-wrap">
  <div class="path"><p>当前位置：内容管理<span>&gt;&gt;</span>设置宝物内容</p></div>
  <div class="main-cont">
    <h3 class="title"><a href="oecms_product.php?action=add" class="btn-general"><span>发布宝物</span></a>设置宝物内容</h3>
	<form action="oecms_product.php" method="post" name="myform" id="myform" style="margin:0">
	<input type="hidden" name="action" id="action" value="savesetting" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
	  <thead class="tb-tit-bg">
	  <tr>
	    <th width="8%"><div class="th-gap">选择</div></th>
		<th width="20%"><div class="th-gap">标题</div></th>
		<th width="20%"><div class="th-gap">Meta标题</div></th>
		<th width="20%"><div class="th-gap">Meta关键字</div></th>
		<th width="20%"><div class="th-gap">Meta描述</div></th>
	  </tr>
	  </thead>
	  <tfoot class="tb-foot-bg"></tfoot>
	  <!--{foreach $product as $volist}-->
	  <tr onMouseOver="overColor(this)" onMouseOut="outColor(this)">
	    <td align="center"><input name="id[]" type="checkbox" value="<!--{$volist.productid}-->" onClick="checkItem(this, 'chkAll')"><!--{$volist.productid}--></td>
		<td align="center"><input type="text" name="productname_<!--{$volist.productid}-->" value="<!--{$volist.productname}-->" size="22" /></td>
		<td align="center"><input type="text" name="metatitle_<!--{$volist.productid}-->" value="<!--{$volist.metatitle}-->" size="20" /></td>
		<td align="center"><input type="text" name="metakeyword_<!--{$volist.productid}-->" value="<!--{$volist.metakeyword}-->" size="20" /></td>
		<td align="center"><input type="text" name="metadescription_<!--{$volist.productid}-->" value="<!--{$volist.metadescription}-->" size="20" /></td>
	  </tr>
	  <!--{foreachelse}-->
      <tr>
	    <td colspan="5" align="center">暂无信息</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{if $total>0}-->
	  <tr>
		<td align="center"><input name="chkAll" type="checkbox" id="chkAll" onClick="checkAll(this, 'id[]')" value="checkbox"></td>
		<td class="hback" colspan="4"><input class="button" name="btn_del" type="button" value="批量更新" onClick="{if(confirm('确定更新选定信息吗!?')){$('#action').val('savesetting');$('#myform').submit();return true;}return false;}" class="button"></td>
	  </tr>
	  <!--{/if}-->
	</table>
	</form>
	<!--{if $pagecount>1}-->
	<table width='95%' border='0' cellspacing='0' cellpadding='0' align='center' style="margin-top:10px;">
	  <tr>
		<td align='center'><!--{$showpage}--></td>
	  </tr>
	</table>
	<!--{/if}-->
  </div>
</div>
<!--{/if}-->


<!--{if $action eq "add"}-->
<div class="main-wrap">
  <div class="path"><p>当前位置：内容管理<span>&gt;&gt;</span>发布宝物</p></div>
  <div class="main-cont">
	<h3 class="title"><a href="oecms_product.php" class="btn-general"><span>返回列表</span></a>发布宝物</h3>
    <form name="myform" id="myform" method="post" action="oecms_product.php" onsubmit='return checkform();' />
    <input type="hidden" name="action" value="saveadd" />
	<table cellpadding='3' cellspacing='3' class='tab'>
	  <tr>
		<td class='hback_1' width="15%">宝物分类 <span class='f_red'></span></td>
		<td class='hback' width="85%"><!--{$cate_select}--> <span id="dcateid" class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物编号 <span class="f_red"></span> </td>
		<td class='hback'><input type="text" name="productnum" id="productnum" class="input-txt" /> <span id='dproductnum' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物名称 <span class="f_red">*</span> </td>
		<td class='hback'><input type="text" name="productname" id="productname" class="input-txt" /> <span id='dproductname' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物图片 <span class="f_red"></span> </td>
		<td class='hback'>
		  <input type="hidden" name="uploadfiles" id="uploadfiles" /><input type="hidden" name="thumbfiles" id="thumbfiles" /><span id='duploadfiles' class='f_red'></span>
		  <iframe id='iframe_t' border='0' frameborder='0' scrolling='no' width='450' height='25' src='upload.php?comeform=myform&inputid=uploadfiles&thumbflag=1&thumbinput=thumbfiles&channel=product&waterflag=<!--{$config.watermarkflag}-->'></iframe>
		</td>
	  </tr>
       <tr>
		<td class='hback_1'>适用性别<span class="f_red"></span> </td>
		<td class='hback'><input type="radio" name="sex" id="sex" class="" value="0" checked="checked" /> 男 <input type="radio" name="sex" id="sex" class="" value="1" /> 女  <input type="radio" name="sex" id="sex" class="" value="3" /> 全部</td>
	  </tr>
       <tr>
		<td class='hback_1'>生肖<span class="f_red"></span> </td>
		<td class='hback'><select name="sx" id="sx">
            <option value="1" label="鼠">鼠</option>
            <option value="2" label="牛">牛</option>
            <option value="3" label="虎">虎</option>
            <option value="4" label="兔">兔</option>
            <option value="5" label="龙">龙</option>
            <option value="6" label="蛇">蛇</option>
            <option value="7" label="马">马</option>
            <option value="8" label="羊">羊</option>
            <option value="9" label="猴">猴</option>
            <option value="10" label="鸡">鸡</option>
            <option value="11" label="狗">狗</option>
            <option value="12" label="猪">猪</option>
			 <option value="13" label="全部">全部</option>
        </select></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物价格 <span class="f_red"></span> </td>
		<td class='hback'><input type="text" name="price" id="price" class="input-s" /> （填写数字，单位为人民币￥） <span id='dprice' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>浏览次数 <span class="f_red"></span> </td>
		<td class='hback'><input type="text" name="hits" id="hits" class="input-s" /> <span id='dhits' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>TAGS </td>
		<td class='hback'><input type="text" name="tag" id="tag" class="input-txt" />  <span id='dtag' class='f_red'></span> (多个请用英文,号隔开) <a href="oecms_tag.php">管理Tags链接</a></td>
	  </tr>
	  <tr>
		<td class='hback_1'>状态设置 </td>
		<td class='hback'><!--{$flag_checkbox}-->，<!--{$elite_checkbox}--></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物链接  </td>
		<td class='hback'><textarea name="intro" id="intro" style='width:60%;height:65px;overflow:auto;color:#444444;'></textarea></td>
	  </tr>
	  <tr>
		<td class='hback_1'>详细介绍 <span class="f_red">*</span></td>
		<td class='hback'>
		  <textarea name="content" id="content" style="width:99%;height:300px;display:none;"></textarea>
		  <script>KE.show({id : 'content' });</script>  <span id='dcontent' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>Meta标题 </td>
		<td class='hback'><input type="text" name="metatitle" id="metatitle" class="input-txt" />  <span id='dmetatitle' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>Meta关键字 <span class="f_red"></span></td>
		<td class='hback'><textarea name="metakeyword" id="metakeyword" style="width:60%;height:45px;display:;overflow:auto;"></textarea> <span id='dmetakeyword' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>Meta描述 <span class="f_red"></span></td>
		<td class='hback'><textarea name="metadescription" id="metadescription" style="width:60%;height:45px;display:;overflow:auto;"></textarea> <span id='dmetadescription' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_none'></td>
		<td class='hback_none'><input type="submit" name="btn_save" class="button" value="添加保存" /></td>
	  </tr>
	</table>
	</form>
  </div>
  <div style="clear:both;"></div>
</div>
<!--{/if}-->

<!--{if $action eq "edit"}-->
<div class="main-wrap">
  <div class="path"><p>当前位置：宝物管理<span>&gt;&gt;</span>编辑宝物</p></div>
  <div class="main-cont">
	<h3 class="title"><a href="oecms_product.php?<!--{$comeurl}-->" class="btn-general"><span>返回列表</span></a>编辑宝物</h3>
    <form name="myform" id="myform" method="post" action="oecms_product.php" onsubmit='return checkform();' />
    <input type="hidden" name="action" value="saveedit" />
	<input type="hidden" name="id" value="<!--{$id}-->" />
	<table cellpadding='3' cellspacing='3' class='tab'>
	  <tr>
		<td class='hback_1' width="15%">宝物分类 <span class='f_red'></span></td>
		<td class='hback' width="85%"><!--{$cate_select}--> <span id="dcateid" class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物编号 <span class="f_red"></span> </td>
		<td class='hback'><input type="text" name="productnum" id="productnum" class="input-txt" value="<!--{$product.productnum}-->" /> <span id='dproductnum' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物名称 <span class="f_red">*</span> </td>
		<td class='hback'><input type="text" name="productname" id="productname" class="input-txt" value="<!--{$product.productname}-->" /> <span id='dproductname' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物图片 <span class="f_red"></span> </td>
		<td class='hback'>
		  <input type="hidden" name="uploadfiles" id="uploadfiles" value="<!--{$product.uploadfiles}-->" /><input type="hidden" name="thumbfiles" id="thumbfiles" value="<!--{$product.thumbfiles}-->" /><span id='duploadfiles' class='f_red'></span>
		    <!--{if $product.thumbfiles!=""}-->
			<iframe id='iframe_t' border='0' frameborder='0' scrolling='no' width='450' height='25' src='upload.php?action=show&comeform=myform&inputid=uploadfiles&thumbflag=1&thumbinput=thumbfiles&channel=product&waterflag=<!--{$config.watermarkflag}-->&picname=<!--{$product.uploadpicname}-->&picurl=<!--{$product.uploadfiles}-->'></iframe>
			<!--{else}-->
			<iframe id='iframe_t' border='0' frameborder='0' scrolling='no' width='450' height='25' src='upload.php?comeform=myform&inputid=uploadfiles&thumbflag=1&thumbinput=thumbfiles&channel=product&waterflag=<!--{$config.watermarkflag}-->'></iframe>
			<!--{/if}-->
		</td>
	  </tr>
     
       <tr>
		<td class='hback_1'>适用性别<span class="f_red"></span> </td>
		<td class='hback'>
         <!--{if $product.sex == 0}-->
        <input type="radio" name="sex" id="sex" class="" value="0" checked="checked" /> 男 <input type="radio" name="sex" id="sex" class="" value="1" /> 女  <input type="radio" name="sex" id="sex" class="" value="3" /> 全部
         <!--{elseif $product.sex == 1}-->
         <input type="radio" name="sex" id="sex" class="" value="0"/> 男 <input type="radio" name="sex" id="sex" class="" value="1" checked="checked" /> 女 <input type="radio" name="sex" id="sex" class="" value="3" /> 全部
          <!--{elseif $product.sex == 3}-->
         <input type="radio" name="sex" id="sex" class="" value="0"/> 男 <input type="radio" name="sex" id="sex" class="" value="1"/> 女
         <input type="radio" name="sex" id="sex" class="" value="3" checked="checked"/> 全部
         <!--{/if}-->
        </td>
	  </tr>
       <tr>
		<td class='hback_1'>生肖<span class="f_red"></span> </td>
		<td class='hback'><select name="sx" id="sx">
         <!--{if $product.sx == 1}-->
            <option value="1" label="鼠" selected="selected">鼠</option>
         <!--{else}-->
          <option value="1" label="鼠">鼠</option>
         <!--{/if}-->   
          <!--{if $product.sx == 2}-->
            <option selected="selected" value="2" label="牛">牛</option>
             <!--{else}-->
             <option value="2" label="牛">牛</option>
             <!--{/if}--><!--{if $product.sx == 3}-->
            <option selected="selected" value="3" label="虎">虎</option>
             <!--{else}-->
             <option value="3" label="虎">虎</option>
             <!--{/if}--><!--{if $product.sx == 4}-->
            <option selected="selected" value="4" label="兔">兔</option>
             <!--{else}-->
             <option value="4" label="兔">兔</option>
             <!--{/if}--><!--{if $product.sx == 5}-->
            <option selected="selected" value="5" label="龙">龙</option>
             <!--{else}-->
             <option value="5" label="龙">龙</option>
             <!--{/if}--><!--{if $product.sx == 6}-->
            <option selected="selected" value="6" label="蛇">蛇</option>
             <!--{else}-->
             <option value="6" label="蛇">蛇</option>
             <!--{/if}--><!--{if $product.sx == 7}-->
            <option selected="selected" value="7" label="马">马</option>
             <!--{else}-->
             <option value="7" label="马">马</option>
             <!--{/if}--><!--{if $product.sx == 8}-->
            <option selected="selected" value="8" label="羊">羊</option>
             <!--{else}-->
             <option value="8" label="羊">羊</option>
             <!--{/if}--><!--{if $product.sx == 9}-->
            <option selected="selected" value="9" label="猴">猴</option>
             <!--{else}-->
             <option value="9" label="猴">猴</option>
             <!--{/if}--><!--{if $product.sx == 10}-->
            <option selected="selected" value="10" label="鸡">鸡</option>
             <!--{else}-->
             <option value="10" label="鸡">鸡</option>
             <!--{/if}--><!--{if $product.sx == 11}-->
            <option selected="selected" value="11" label="狗">狗</option>
             <!--{else}-->
             <option value="11" label="狗">狗</option>
             <!--{/if}--><!--{if $product.sx == 12}-->
            <option selected="selected" value="12" label="猪">猪</option>
             <!--{else}-->
             <option value="12" label="猪">猪</option>
 			<!--{/if}-->
            <!--{if $product.sx == 13}-->
            <option selected="selected" value="13" label="全部">全部</option>
             <!--{else}-->
             <option value="13" label="全部">全部</option>
 			<!--{/if}-->
        </select></td>
	  </tr>
      
	  <tr>
		<td class='hback_1'>宝物价格 <span class="f_red"></span> </td>
		<td class='hback'><input type="text" name="price" id="price" class="input-s" value="<!--{$product.price}-->" /> （填写数字，单位为人民币￥） <span id='dprice' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>浏览次数 <span class="f_red"></span> </td>
		<td class='hback'><input type="text" name="hits" id="hits" class="input-s" value="<!--{$product.hits}-->" /> <span id='dhits' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>TAGS </td>
		<td class='hback'><input type="text" name="tag" id="tag" class="input-txt" value="<!--{$product.tag}-->" />  <span id='dtag' class='f_red'></span> (多个请用英文,号隔开) <a href="oecms_tag.php">管理Tags链接</a></td>
	  </tr>
	  <tr>
		<td class='hback_1'>状态设置 </td>
		<td class='hback'><!--{$flag_checkbox}-->，<!--{$elite_checkbox}--></td>
	  </tr>
	  <tr>
		<td class='hback_1'>宝物链接 </td>
		<td class='hback'><textarea name="intro" id="intro" style='width:60%;height:65px;overflow:auto;color:#444444;'><!--{$product.intro}--></textarea></td>
	  </tr>
	  <tr>
		<td class='hback_1'>详细内容 <span class="f_red">*</span></td>
		<td class='hback'>
		  <textarea name="content" id="content" style="width:99%;height:300px;display:none;"><!--{$product.content}--></textarea>
		  <script>KE.show({id : 'content' });</script>  <span id='dcontent' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>Meta标题 </td>
		<td class='hback'><input type="text" name="metatitle" id="metatitle" class="input-txt" value="<!--{$product.metatitle}-->" />  <span id='dmetatitle' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>Meta关键字 <span class="f_red"></span></td>
		<td class='hback'><textarea name="metakeyword" id="metakeyword" style="width:60%;height:45px;display:;overflow:auto;"><!--{$product.metakeyword}--></textarea> <span id='dmetakeyword' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_1'>Meta描述 <span class="f_red"></span></td>
		<td class='hback'><textarea name="metadescription" id="metadescription" style="width:60%;height:45px;display:;overflow:auto;"><!--{$product.metadescription}--></textarea> <span id='dmetadescription' class='f_red'></span></td>
	  </tr>
	  <tr>
		<td class='hback_none'></td>
		<td class='hback_none'><input type="submit" name="btn_save" class="button" value="更新保存" /></td>
	  </tr>
	</table>
	</form>
  </div>
  <div style="clear:both;"></div>
</div>
<!--{/if}-->
</body>
</html>
<script type="text/javascript">
function checkform() {
	var t = "";
	var v = "";

	t = "productname";
	v = $("#"+t).val();
	if(v=="") {
		dmsg("宝物名称不能为空", t);
		return false;
	}

	t = 'content';
	v = KE.html(t).length;
	if(v=="") {
		dmsg("详细内容不能为空", t);
		return false;
	}

	return true;
}
</script>